<template>
  <el-form>
    <el-form-item label="真实姓名">
      <el-input v-model.trim="user.realName" />
    </el-form-item>
    <el-form-item label="登录账号">
      <el-input v-model.trim="user.name" />
    </el-form-item>
    <el-form-item label="邮箱地址">
      <el-input v-model.trim="user.email" />
    </el-form-item>
    <el-form-item label="手机号码">
      <el-input v-model.trim="user.phone" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="submit">更新信息</el-button>
      <el-button type="primary" @click="handleModel">修改密码</el-button>
    </el-form-item>
    <ModifyPassword ref="modifyPassword" />
  </el-form>
</template>

<script>
import ModifyPassword from '@/views/profile/components/module/ModifyPassword'

export default {
  components: { ModifyPassword },
  props: {
    user: {
      type: Object,
      default: () => {
        return {
          name: '',
          email: '',
          phone: ''
        }
      }
    }
  },
  methods: {
    handleModel() {
      this.$refs.modifyPassword.visible = true
    },
    submit() {
      this.$message({
        message: '暂时不能修改',
        type: 'success',
        duration: 5 * 1000
      })
    }
  }
}
</script>
